-- medal
-- created by limj
-- 道具描述：荣誉之证

return {
    -- 获取道具描述
    getDesc = function(itemId, args, para)
        local petId     = args["pet_id"];
        local petName   = PetM.query(petId, "name");
        local heroDesc  = PetM.query(petId, "desc");

        return heroDesc;
    end,

    getDetail = function(itemId, args, para)
        local effect = "";
        local props = EquipM.query(itemId).prop;
        for i = 1, #props do
            if (props[i][1] == 200 and table.indexOf({"fire","armor","speed","luck"}, props[i][2]) < 0) and
                i + 1 <= #props and
               (props[i+1][1] == 200 and table.indexOf({"fire","armor","speed","luck"}, props[i+1][2]) < 0) then
                local desc = extractString(PropM.getPropDesc(props[i])) .. getLocStr("seperator");
                effect = effect .. string.format("[blue]%s[-]", desc);
            else
                local desc = extractString(PropM.getPropDesc(props[i]));
                effect = effect .. string.format("[blue]%s[-]", desc) .. "\n";
            end
        end

        return effect;
    end,
};
